package edu.ybu.manage.service.impl;

import edu.ybu.manage.mapper.DealerMapper;
import edu.ybu.manage.pojo.Dealer;
import edu.ybu.manage.service.DealerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class DealerServiceImpl implements DealerService {
    @Autowired
    private DealerMapper dealerMapper;
    @Override
    public List<Dealer> selectAll() {
        return dealerMapper.selectAll();
    }
    @Override
    public Integer selectAllCount() {
        return dealerMapper.selectAllCount();
    }
    @Override
    public List<Dealer> selectAllByPage(Integer page, Integer limit) {
        return dealerMapper.selectAllByPage(page, limit);
    }
    @Override
    public Integer selectAllByPageCount(Integer page, Integer limit) {
        return dealerMapper.selectAllByPageCount(page,limit);
    }

    @Override
    public Integer insertDealer(Dealer dealer) {
        return dealerMapper.insert(dealer);
    }

    @Override
    public Integer deleteById(Integer id) {
        return dealerMapper.deleteById(id);
    }

    @Override
    public Integer deleteByIds(List<Integer> ids) {
        return dealerMapper.deleteBatchIds(ids);
    }

    @Override
    public Integer updateById(Dealer dealer) {
        return dealerMapper.updateById(dealer);
    }

    @Override
    public List<Dealer> selectByCondition(Dealer dealer) {
        return dealerMapper.selectByConditon(dealer);
    }
}
